package com.sporadic.desk.controller;

import com.sporadic.desk.pojo.Goods;
import com.sporadic.desk.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import vo.ResponseData;

import java.util.List;

/**
 * @program: sporadic
 * @description:
 * @author: LHD   QQ:1727865856
 * @create: 2019-10-15 13:58
 **/
@RestController
public class TestController {

    @Autowired
    private GoodsService goodsService;

    @GetMapping("/all")
    public ResponseData<List<Goods>> all() {
//        if (true){
//            throw new RuntimeException("test异常处理");
//        }
        return new ResponseData<List<Goods>>(goodsService.list());
    }
}
